package com.chain.BrotherExchange.ui.activity;

import android.content.Context;
import android.content.Intent;
import android.support.design.widget.TabLayout;
import android.support.v4.view.ViewPager;

import com.chain.BrotherExchange.R;
import com.chain.BrotherExchange.ui.adapter.SimpleFragmentPagerAdapter;
import com.chain.BrotherExchange.ui.core.BaseActivity;
import com.chain.BrotherExchange.ui.fragment.LockedPositionFragment;
import com.chain.BrotherExchange.utils.ActivityBarHelper;

import java.util.ArrayList;
import java.util.Arrays;

import butterknife.Bind;

/**
 * 锁仓明细
 */
public class LockedPositionActivity extends BaseActivity {

    @Bind(R.id.tab_layout)
    TabLayout mTabLayout;
    @Bind(R.id.view_pager)
    ViewPager mLockedPositionViewPager;

    public static void launch(Context context) {
        context.startActivity(new Intent(context, LockedPositionActivity.class));
    }

    @Override
    protected int getLayoutID() {
        return R.layout.activity_locked_position;
    }

    @Override
    protected void initActions() {
        ActivityBarHelper.init(this, R.string.title_assets_details);

        mTabLayout.setupWithViewPager(mLockedPositionViewPager);
        mLockedPositionViewPager.setAdapter(new SimpleFragmentPagerAdapter(
                getSupportFragmentManager(),
                new ArrayList<>(Arrays.asList(
                        LockedPositionFragment.newLockedPosition(),
                        LockedPositionFragment.newRelease(),
                        LockedPositionFragment.newUnlock(),
                        LockedPositionFragment.newGeneralize(),
                        LockedPositionFragment.newNode()
                )),
                new ArrayList<>(Arrays.asList(
                        getString(R.string.title_locking_details),
                        getString(R.string.title_release_details),
                        getString(R.string.title_unlock_details),
                        getString(R.string.title_promotion_reward),
                        getString(R.string.title_node_reward))))
        );
    }
}
